Add extensionless URL support with file copies and Lighthouse CI configuration - #159
Add extensionless URL support with file copies and Lighthouse CI configuration#159fulldecent with Copilot wants to merge 6 commits into
Conversation
Co-authored-by: fulldecent <382183+fulldecent@users.noreply.github.com>
lhci autorun which symlinks all .html files to extensionless in the build folder
also run the tests yourself to ensure it is working|
@copilot see how the CI failed and fix your PR |
Co-authored-by: fulldecent <382183+fulldecent@users.noreply.github.com>
Fixed the CI failures! The issue was in the workflow execution order - symlinks were being created in the Lighthouse job after the test job had already checked for them. I moved the symlink creation to the build phase (commit 27d84ad) so they're included in the build artifact and available for both testing and Lighthouse CI. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot ensure that there is some minimal amount of content on each of the webpages, so that lighthouse will be able to achieve FCP |
Co-authored-by: fulldecent <382183+fulldecent@users.noreply.github.com>
Added substantial content to all webpages to ensure Lighthouse can achieve good FCP scores:
All pages now have meaningful text content, proper styling, and semantic HTML structure to support First Contentful Paint measurements. (commit c987123) |
|
@copilot study the Actions output and fix the lighthouse build |
…dd Lighthouse config Co-authored-by: fulldecent <382183+fulldecent@users.noreply.github.com>
Fixed the Lighthouse CI failures! The issue was twofold:
The key changes (commit fe18bbf):
This should resolve both the test failures and the NO_FCP errors in the Lighthouse job. |
|
@copilot this part Is causing an error. Please incorporate a fix to this error in your PR Run yarn lint-fix too |
- Added robust error handling for missing/invalid external sitemap structure - Added checks for build directory existence before reading/writing - Script now gracefully handles network errors and missing URLs - Ran yarn lint-fix to fix code style issues - All sitemap generation scenarios now work correctly Co-authored-by: fulldecent <382183+fulldecent@users.noreply.github.com>
... Fixed the
Added robust error handling for all these scenarios. The script now gracefully falls back to generating a sitemap with the current date when external resources are unavailable. Also ran Changes in commit 59e1b71:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This PR adds extensionless URL support during the build phase and enhances webpage content to ensure optimal Lighthouse First Contentful Paint (FCP) scores.
Problem
GitHub Pages and modern web servers often support extensionless URLs, but the current build process only generates
.htmlfiles, making extensionless URLs inaccessible during Lighthouse testing and deployment. Additionally, some pages had minimal content that could negatively impact Lighthouse FCP scoring.Solution
Extensionless URL Support
Added a new script
scripts/create-extensionless-symlinks.mjsthat:.htmlfiles in the build directory.htmlextension for better CI/CD artifact compatibilityindex.htmlfiles (since directories serve as their extensionless versions)Lighthouse CI Configuration
Added
lighthouserc.jsconfiguration file to ensure proper Lighthouse testing:Content Enhancement for Lighthouse FCP
Enhanced all pages with meaningful content to ensure good First Contentful Paint scores:
Bug Fixes
Example
Before:
After:
This enables URLs like:
/about(extensionless copy) and/about.html(original)/contact(extensionless copy) and/contact.html(original)/blog/post1(extensionless copy) and/blog/post1.html(original)Changes Made
scripts/create-extensionless-symlinks.mjswith file copy approach for better artifact compatibilitytest/extensionless-symlinks-checker.mjsto validate extensionless file creation and integrated it into the main test suite.github/workflows/build-test-deploy.ymlto create extensionless files during the build phase (after sitemap generation)lighthouserc.jsfor proper CI testing with static server and timeout configurationsCompatibility
The implementation aligns with the existing canonical link plugin that expects extensionless URLs, providing a complete solution for modern web URL practices and performance optimization.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.